<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8"/>
    <title></title>
</head>
<body>
<script type="text/javascript" src="../lib/jquery/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="../lib/jquery/jquery.cookie.js"></script>
<script type="text/javascript">
//    $.cookie("aa",1,{expires:3});
//    var aa = $.cookie("aa");
//    console.log(aa);

//    var newObject = jQuery.extend(true, {}, oldObject);
    var a=[{id:5,name:"aa"},{id:6,name:"bb"}];
    b=jQuery.extend(true, {}, a);
    a[0].id=6;
    console.log(b[0].id);
    b.length = 2;
    b = Array.prototype.slice.call(b);
    console.log(b);
    $(function(){
        var a = [1, 2, 3];
        var b = [5, 6];
        function change() {
            var c = a;
            a[0] = 4;
            a = b;
            b = c;
        };
        change();
        alert(a);   //"5,6"
        alert(b);   //"4,2,3"

    });


</script>
</body>
</html>